﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Users/Usuario.Master" AutoEventWireup="true"
    CodeBehind="ViewUser.aspx.cs" Inherits="Juntae.Users.ViewUser" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <!--[if IE]>
   <style type="text/css">
   #dados_usuario, #euvou, #evento1, #evento2, #amigos {
       background:transparent;
       filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#F9F9F9,endColorstr=#F9F9F9);
       border-color: #E9E9E9;
       border-style: solid;
	   border-width: 1.5px;
       zoom: 1;
    } 
    </style>
<![endif]-->
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
    <script type="text/javascript">
        function UsuarioPopulado(sender, e) {
            var usuarios = sender.get_completionList().childNodes;
            for (var i = 0; i < usuarios.length; i++) {
                usuarios[i].innerHTML = "<table><tr><td><img style = 'height:50px;width:50px;cursor:pointer;' src= '/img/Users_Avatar/" + usuarios[i]._value + ".jpg' /></td><td>" + usuarios[i].firstChild.nodeValue + "<br /></td></tr></table>";
            }
        }
        function UsuarioSelecionado(source, eventArgs) {
            var idx = source._selectIndex;
            var usuarios = source.get_completionList().childNodes;
            window.location = "ViewUser.aspx?profile=" + usuarios[idx]._value;
        }

        function InserirComentario(idEvento) {
            if (window.event)
                key = window.event.keyCode;
            else
                key = e.which;

            if (key == 13) {
                if (document.getElementById('<%= txtInserirComentario.ClientID %>').value == '') {
                } else {
                    var comentario = document.getElementById('<%= txtInserirComentario.ClientID %>').value;
                    var idMembership = queryString();
                    PageMethods.InserirComentario(idEvento, comentario, idMembership, onSucess, onError);
                }
            }
        }

        function onSucess() {
            var btn = document.getElementById('<%= btnUpdateComentario.ClientID %>');
            btn.click();
        }

        function onError(error) {
            alert('Erro ao efetuar operação');
        }

        function deleteComment(idComment) {
            PageMethods.DeletarComentario(idComment, onSucess, onError);
        }

        function queryString() {
            var url = document.location.href;
            var query = url.split('=');
            var idmembership = query[1];
            return idmembership;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="style1">
        <tr>
            <td>
                <div id="esquerda">
                    <asp:UpdatePanel ID="updatePanelFoto" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:UpdateProgress ID="UpdateProgressFoto" runat="server" AssociatedUpdatePanelID="updatePanelFoto"
                                EnableViewState="False">
                                <ProgressTemplate>
                                    <img alt="Carregando..." src="../img/progress.gif" class="loading_foto" />
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div id="foto" onmouseover="document.getElementById('alterar_foto').style.visibility = 'visible'"
                                onmouseout="document.getElementById('alterar_foto').style.visibility = 'hidden'">
                                <asp:Image ID="foto_perfil" runat="server" CssClass="img_foto" ImageUrl="~/img/back_nophoto.png" />
                            </div>
                            <div id="uploadFoto_Perfil" onmouseover="document.getElementById('alterar_foto').style.visibility = 'visible'"
                                onmouseout="document.getElementById('alterar_foto').style.visibility = 'hidden'">
                                <asp:AsyncFileUpload ID="FileUploadClass_Perfil" runat="server" PersistFile="True"
                                    Width="112px" UploaderStyle="Traditional" CssClass="FileUploadClass_Perfil" EnableViewState="False"
                                    Font-Names="Verdana" Font-Size="11px" ForeColor="White"/>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div id="dados_usuario">
                        <h4>
                            <asp:Label ID="lblNome" runat="server" Text="Label"></asp:Label></h4>
                        &nbsp;<div id="txtMsg">
                            <asp:TextBox ID="txtMsgPerfil" runat="server" Text="Digite aqui sua mensagem" CssClass="txtMsgInput"
                                ReadOnly="True"></asp:TextBox>
                            <br />
                            <br />
                            <asp:UpdatePanel ID="updatePanelAddAmigo" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:UpdateProgress ID="updateProgressAddAmigo" runat="server" AssociatedUpdatePanelID="updatePanelAddAmigo"
                                        EnableViewState="False" DisplayAfter="100">
                                        <ProgressTemplate>
                                            <img alt="Enviando solicitação..." src="../img/progress.gif" class="loading_solicitacao_amigo" />
                                        </ProgressTemplate>
                                    </asp:UpdateProgress>
                                    <asp:ImageButton ID="btnAddAmigo" CssClass="btnAddAmigo" ImageUrl="~/img/btnaddamigos.png"
                                        runat="server" ToolTip="Adicionar como amigo" OnClick="btnAddAmigo_Click" Visible="False"
                                        CausesValidation="False" />
                                    <asp:Image ID="img_wait" runat="server" ImageUrl="~/img/wait_icon.png" CssClass="img_wait"
                                        Visible="False" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </div>
                    <asp:Button ID="btnUpdateComentario" CssClass="hidden" runat="server" Text="Button"
                        OnClick="btnUpdateComentario_Click" />
                    <asp:Button ID="btnDeleteComentario" CssClass="hidden" runat="server" Text="Button"
                        OnClick="btnDeleteComentario_Click" />
                    <img src="../../img/img_eventos.png" class="img_evento1" alt="Eventos" /><br />
                    <br />
                    <asp:UpdatePanel ID="UpdatePanelEvento1" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanelEvento1"
                                EnableViewState="False">
                                <ProgressTemplate>
                                    <img alt="Carregando..." src="../img/progress.gif" class="loading_msg_perfil" />
                                </ProgressTemplate>
                            </asp:UpdateProgress>
                            <div id="evento1" runat="server" class="evento1">
                                <asp:Image ID="icon_evento" runat="server" CssClass="icon_evento1" Height="48px"
                                    Width="48px" />
                                <p class="titulo_evento1">
                                    <asp:HyperLink ID="nm_usuario_evento" runat="server"></asp:HyperLink>,
                                    <asp:Label ID="lbl_vai_participar" runat="server" Text="Label"></asp:Label>
                                    <asp:HyperLink ID="nm_evento" runat="server" Font-Underline="True"></asp:HyperLink><br />
                                </p>
                                <span>
                                    <asp:LinkButton ID="lnk_visualizar_comentarios" runat="server" CssClass="lnk_view_all_comments"
                                        OnClick="lnk_visualizar_comentarios_Click"></asp:LinkButton>
                                    <div id="box_recado_evento" runat="server" class="box_recado_evento">
                                        <asp:Image ID="foto_comentario" runat="server" CssClass="foto_recado" ImageUrl="~/img/back_nophoto_menor.jpg"
                                            Height="50px" Width="50px" />
                                        <asp:LinkButton ID="lnkUserComment" runat="server" CssClass="lnkUserComment" Width="200px"></asp:LinkButton><span>
                                            <asp:Label ID="lblComentario" runat="server" Width="400px" Text=""></asp:Label><br />
                                        </span>
                                        <asp:ImageButton ID="btnTrash" runat="server" CssClass="trash_evento" ImageUrl="~/img/trash_icon.png" /><br />
                                    </div>
                                    <div id="box_inserir_recado_evento" runat="server" class="box_inserir_recado_evento">
                                        <asp:Image ID="img_user_logged" runat="server" CssClass="foto_recado_inserir_recado_evento"
                                            Width="50px" Height="50px" />
                                        <asp:RequiredFieldValidator ID="requiredComentario" runat="server" ControlToValidate="txtInserirComentario"
                                            SetFocusOnError="True" ValidationGroup="comment"></asp:RequiredFieldValidator>
                                        <asp:TextBox Text="Digite seu comentário e pressione Enter para enviá-lo" CssClass="input_recado_evento"
                                            ID="txtInserirComentario" runat="server" onfocus="limparTxt(this);" onblur="defaultValueTxt(this);"
                                            ValidationGroup="comment"></asp:TextBox>
                                    </div>
                                    <p>
                                        &nbsp</p>
                                    <p>
                                        &nbsp</p>
                            </div>
                            </span>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="btnUpdateComentario" EventName="Click" />
                        </Triggers>
                    </asp:UpdatePanel>
                    <br />
                    <br />
                </div>
                </div>
                <div id="euvou" runat="server" class="euvou">
                    <img src="../../img/img_euvou.png" alt="Eu Vou!" class="img_euvou" />
                </div>
                <div id="amigos" class="div_amigos">
                    <img src="../../img/img_amigos.png" alt="Amigos" class="img_amigos" />
                    <input type="text" class="input_procurar_amigos" value="Procurar amigos..." onfocus="limparTxt(this);"
                        onblur="defaultValueTxt(this);" />
                    <a href="#">
                        <img src="../../img/btnBuscar.jpg" class="btnBuscarAmigo" border="0" alt="Pesquisar" /></a>
                    <div id="fotos_amigo">
                        <br />
                        <br />
                        <table>
                            <tr>
                                <td>
                                    <a href="#">
                                        <img src="../../img/back_nophoto_menor.jpg" class="" border="0" alt="Pesquisar" /></a>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
